//
// Created by admin on 2024/8/1.
//

#ifndef _HAL_I2C_H
#define _HAL_I2C_H

#include "stdint.h"

int i2cBegin(void *i2c, uint8_t addrSize);
int i2cWrite(void *i2c, uint16_t devAddr, uint8_t *buff, uint32_t size, uint8_t stop);
int i2cRead(void *i2c, uint16_t devAddr, uint8_t *buff, uint32_t size, uint8_t stop);
int i2cRegRead(void *i2c, uint16_t devAddr, uint16_t reg, uint8_t addrSize, uint8_t *buff, uint32_t size);
int i2cRegWrite(void *i2c, uint16_t devAddr, uint16_t reg, uint8_t addrSize, uint8_t *buff, uint32_t size);
void i2cEventCallback(void *i2c, int event, uint32_t size);

#endif //_HAL_I2C_H
